package sword;

/**
 * @Author: 海琳琦
 * @Date: 2022/5/28 20:37
 * https://leetcode.cn/problems/er-cha-shu-de-shen-du-lcof/
 */
public class Title55 {

    class TreeNode{
        int val;

        TreeNode left;

        TreeNode right;

        public TreeNode(int val) {
            this.val = val;
        }
    }


    public int maxDepth(TreeNode root) {
        if (root == null) {
            return 0;
        }
        int left = maxDepth(root.left);
        int right = maxDepth(root.right);
        return Math.max(left, right) + 1;
    }

    public static void main(String[] args) {

    }
}
